#include "../include/narytree.h"
#include "../include/VFS_BST.h"
#include "../include/string_tok.h"
#include "../include/vfs_errorcodes.h"

l_node *start = NULL;
t_node *root = NULL;
b_node* bst_root = NULL;
l_node *h_bucket[62];
char label[20];

int size_meta_header;
int size_of_header_1;
int size_of_header_2;
int max_fd; 
int current_fd_id; 
int no_of_fd;
int is_mounted = 0;
FILE *fp1; //Pointer will point to big data file

void create ( char *label1, int size );

void mount ( char *label1 );

void unmount ( char *label1 );

int savetree( t_node *subtree, FILE *fileDes, int (*save_node) ( FILE *fileDes, fd *data ) );

void free_recur(t_node **root);

int save_node( FILE *fileDes, fd *data );


//directory operations

void dmake ( char *path, char *dirname );

void ddelete ( char *path );

void dmove ( char *P1, char *P2 );

void dlist ( char *P1, int P2, char *P3 );


//file operations

void fadd ( char *P1, char *P2, char *P3 );

void flist ( char *P1, char *P2);

void fupdate ( char *P1, char *P2 );

void fremove ( char *P1);

void fmove ( char *P1, char *P2 );

void fcopy ( char *P1, char *P2 );

void fexport ( char *P1, char *P2 );

void fsearch ( char *P1, char *P2 );

char * slash_truncate(char *P1);

char *substring(char *string, int position, int length); 
